package it.com.Test.a1_async;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TestOfRunAsAsync {

    static ExecutorService executor = Executors.newFixedThreadPool(3);

    public static void main(String[] args) {
        // 无返回值
        System.out.println("main....start....");
        CompletableFuture.runAsync(() -> {
            System.out.println("当前线程：" + Thread.currentThread().getId());
            int i = 10 / 2;
            System.out.println("运行结果：" + i);
        }, executor);
        System.out.println("main....end....");
    }
    /**
     * main....start....
     * main....end....
     * 当前线程：12
     * 运行结果：5
      */
}
